Can someone please help.

Kinja'd!!! "Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord." (ningaboss)
03/23/2016 at 21:59 • Filed to: None

Kinja'd!!!0 Kinja'd!!! 29
Kinja'd!!!

I don’t know if I did this right.

http://media.education2020.com.education2020.us/manuals/CSC210…

Yes i’m asking for homework help on oppo.


DISCUSSION (29)


Kinja'd!!! Nauraushaun > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 22:04

Kinja'd!!!0

Looks good. Shouldn’t be obvious if it’s right by running it?

I’d run it if it weren’t a screenshot ;)


Kinja'd!!! Rusty Vandura - www.tinyurl.com/keepoppo > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 22:07

Kinja'd!!!3

You didn’t spell “dorque” correctly.


Kinja'd!!! Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord. > Nauraushaun
03/23/2016 at 22:07

Kinja'd!!!0

I thought about it until i looked and saw this and I don’t seem to get what its asking. “b. Reassign the new list value to the variable name string_to_list. TIP: You can do this by adding the variable name and an equals sign before the code that creates the new list value.”


Kinja'd!!! Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord. > Rusty Vandura - www.tinyurl.com/keepoppo
03/23/2016 at 22:08

Kinja'd!!!0

lol


Kinja'd!!! twochevrons > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 22:12

Kinja'd!!!0

Just run it, it won’t hurt ;)

For the record, it’s mostly, but not quite right. The results from running it might give you a clue as to what needs to be changed.


Kinja'd!!! Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord. > Nauraushaun
03/23/2016 at 22:12

Kinja'd!!!0

from collections import deque

list_stack = []

list_queue = deque([])

string_to_list = “who what when where why how”

string_to_list.split()

for i in string_to_list:

list_stack.append(i)

list_queue.appendleft(i)

print(“The value created as a stack:”, list_stack)

print(“The value created as a queue:”, list_queue)


Kinja'd!!! Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord. > twochevrons
03/23/2016 at 22:16

Kinja'd!!!0

I mean it seems right: The value created as a stack: [’w’, ‘h’, ‘o’, ‘ ‘, ‘w’, ‘h’, ‘a’, ‘t’, ‘ ‘, ‘w’, ‘h’, ‘e’, ‘n’, ‘ ‘, ‘w’, ‘h’, ‘e’, ‘r’, ‘e’, ‘ ‘, ‘w’, ‘h’, ‘y’, ‘ ‘, ‘h’, ‘o’, ‘w’]

The value created as a queue: deque([’w’, ‘o’, ‘h’, ‘ ‘, ‘y’, ‘h’, ‘w’, ‘ ‘, ‘e’, ‘r’, ‘e’, ‘h’, ‘w’, ‘ ‘, ‘n’, ‘e’, ‘h’, ‘w’, ‘ ‘, ‘t’, ‘a’, ‘h’, ‘w’, ‘ ‘, ‘o’, ‘h’, ‘w’])

Save and run the program. Make sure it prints the list_stack and list_queue values when it runs. TIP: The stack and queue values will include the elements in reverse order from one another.


Kinja'd!!! Nauraushaun > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 22:16

Kinja'd!!!0

I think that’s just saying use:

string_to_list = string_to_list.split()

In fact that’s a good point. I don’t think your code will work. In Python strings are immutable which means you can’t change them. For:

string_to_list.split()

To work it needs to modify the value of string_to_list. I think it will only return the value, which means you’re not storing it and it’s being lost.

But that should be very obvious if you’ve run it ;)


Kinja'd!!! PorkchoPlissken > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 22:17

Kinja'd!!!0

I don’t even wish I knew how to help with whatever the hell this is


Kinja'd!!! Nauraushaun > Nauraushaun
03/23/2016 at 22:18

Kinja'd!!!0

Kinja'd!!!

In this example I:

- Create a variable named “variable”

- Assign a string to it

- Split the string, which returns the result in square brackets - an actual list

- Show the contents of the variable, which still contains the unsplit string

So to store the list value, I’d need to re-assign it to my variable using:

variable = variable.split()


Kinja'd!!! MUSASHI66 > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 22:20

Kinja'd!!!0

Kinja'd!!!

Obviously, I hate coding.


Kinja'd!!! Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord. > Nauraushaun
03/23/2016 at 22:21

Kinja'd!!!0

So it’s meant to be like this?

from collections import deque

list_stack = []

list_queue = deque([])

string_to_list = “who what when where why how”

string_to_list = string_to_list.split()

string_to_list.split()

for i in string_to_list:

list_stack.append(i)

list_queue.appendleft(i)

print(“The value created as a stack:”, list_stack)

print(“The value created as a queue:”, list_queue)


Kinja'd!!! Nauraushaun > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 22:25

Kinja'd!!!2

That’s the correct approach. Except you’ve still got the line:

string_to_list.split()

In there which isn’t required will throw an error.

Again, you should be able to run it to prove it works. I have :) If you don’t know how to execute your code, I can tell you.

The world of software is based on testing, something only works when you’ve tested it thoroughly to prove that it does. No one will trust your code until it’s run.

And you need to understand why it worked! Immutability is a design choice in Python and will affect the way you code!


Kinja'd!!! Nauraushaun > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 22:28

Kinja'd!!!0

It’s asking you to get the words in reverse order to each other. This has done the letters of the strings, not the words, because your split isn’t being applied.


Kinja'd!!! Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord. > Nauraushaun
03/23/2016 at 22:31

Kinja'd!!!1

Wow! thank you so much for helping me I got the result I wanted :D

Kinja'd!!!


Kinja'd!!! Daily Drives a Dragon - One Last Lap > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 22:37

Kinja'd!!!0

What language is this?


Kinja'd!!! Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord. > Daily Drives a Dragon - One Last Lap
03/23/2016 at 22:37

Kinja'd!!!0

Python


Kinja'd!!! scoob > Daily Drives a Dragon - One Last Lap
03/23/2016 at 23:01

Kinja'd!!!1

English


Kinja'd!!! Daily Drives a Dragon - One Last Lap > scoob
03/23/2016 at 23:05

Kinja'd!!!0

Programming language..... Smartass.


Kinja'd!!! scoob > Daily Drives a Dragon - One Last Lap
03/23/2016 at 23:09

Kinja'd!!!0

Yeah, it’s the Programming language. So why’d you ask?


Kinja'd!!! Daily Drives a Dragon - One Last Lap > scoob
03/23/2016 at 23:16

Kinja'd!!!0

Because I wasn’t sure what it was.


Kinja'd!!! scoob > Daily Drives a Dragon - One Last Lap
03/23/2016 at 23:20

Kinja'd!!!0

But you know it’s the Programming language. You must’ve learned some Programming to know it’s the Programming language. Have you ever been to Programming? I think you’d enjoy it quite well. The Programmingers would prefer you speak Programming though, and not English.


Kinja'd!!! Daily Drives a Dragon - One Last Lap > scoob
03/23/2016 at 23:22

Kinja'd!!!0

I’ve done a little Java


Kinja'd!!! scoob > Daily Drives a Dragon - One Last Lap
03/23/2016 at 23:28

Kinja'd!!!0

I GIVE UP I WAS TRYING TO BE SOMEWHAT FUNNY AHHH


Kinja'd!!! Daily Drives a Dragon - One Last Lap > scoob
03/23/2016 at 23:31

Kinja'd!!!1

Daily has gotten the recommended 8 hours of sleep.

Granted those 8 hours have been spread out since last weekend. I haven’t slept more than 3 hours a night this week. I am too tired to understand humor. Does not compute.


Kinja'd!!! scoob > Daily Drives a Dragon - One Last Lap
03/23/2016 at 23:34

Kinja'd!!!0

I’ve gotten 8 hours the past 2 nights so kiiinda know that feel. Today I fell asleep probably like 6 times in my 2 classes.


Kinja'd!!! Daily Drives a Dragon - One Last Lap > scoob
03/23/2016 at 23:37

Kinja'd!!!0

I’ll just sleep during spring break. Oh wait. No I won’t.


Kinja'd!!! Nauraushaun > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 23:51

Kinja'd!!!0

Nice :D


Kinja'd!!! gmporschenut also a fan of hondas > Panther Brown Tdi Volvo Shooting Brake Manual Miata RWD Wagon Stole HondaBro's Accord.
03/23/2016 at 23:55

Kinja'd!!!0

don’t mix up your : and ;. That bit me in the ass twice.